<?php
/*
Template Name: Blog Archives
*/
?>
<?php 
global $options;
foreach ($options as $value) {
    if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); }
}
get_header(); ?>


<div id="content">
<div class="wrap">
      
	<h1><?php the_title(); ?></h1>
	<p class="postmetadata"><?php edit_post_link( __('EDIT', 'wpzoom'), '', ''); ?></p>
	
	<div class="sep">&nbsp;</div>

	<?php query_posts('showposts=20'); ?>
	<div class="posts posts-5">
	<h3 class="archive"><?php _e('The Last 20 Posts', 'wpzoom');?></h3>
	<?php
	$i = 0;
	while (have_posts()) : the_post();
	$i++;
	update_post_caches($posts);
	?>
		<div class="post post-small<?php if ($i == 5) {echo" post-last";} ?>">
		<div class="cover"><?php 
			if ( current_theme_supports( 'post-thumbnails' ) && has_post_thumbnail() ) {
				$thumbURL = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), '' );
				$img = $thumbURL[0]; 
			}
				
			else {
				unset($img);
				if ($wpzoom_cf_use == 'Yes')
				{
					$img = get_post_meta($post->ID, $wpzoom_cf_photo, true);
				}
				else
				{
					if (!$img)
					{
						$img = catch_that_image($post->ID);
					}
				}
			}
			if ($img){ 
			$img = wpzoom_wpmu($img);
			?><a href="<?php the_permalink(); ?>" rel="bookmark,nofollow" title="<?php the_title(); ?>"><img src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?src=<?php echo $img ?>&amp;h=200&amp;w=184&amp;zc=1" height="200" width="184" alt="<?php the_title(); ?>" /></a>
			<?php }	?>
		</div>
		<div class="info"><h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2></div>
		</div><?php if ($i == 5) {$i = 0; echo"<div class=\"clear\">&nbsp;</div><br />";} ?>
		<?php endwhile; ?>          
	<div class="clear">&nbsp;</div>
	</div><!-- end .posts .posts-5 -->
	<div class="sep">&nbsp;</div>
</div><!-- end .wrap -->
</div><!-- end #content -->
<?php get_footer(); ?>
